package com.policyCloud.policyGateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@SpringBootApplication
@RestController
@EnableEurekaClient
public class PolicyGatewayApplication {

	public static void main(String[] args) {
		SpringApplication.run(PolicyGatewayApplication.class, args);
	}

	@RequestMapping("/error")
	public List<String> error() {
		return Arrays.asList("发生错误.");
	}

	@RequestMapping(value = "/fallbackcontroller")
	public Map<String, String> fallBackController() {
		Map<String, String> res = new HashMap();
		res.put("code", "-100");
		res.put("data", "服务挂了");
		return res;
	}


}
